var utils = require('../../../utils/util.js')
var c = require('../../../utils/config.js')
Page({
    data: {
        data: [

        ],
        order_no: "",
        img_url: c.img_url
    },
    onLoad: function (options) {
        utils.checkLogin();
        this.setData({
            order_no: options.order_no
        })
        this.getWuliu();

    },
    onShow: function () {
    },

    getWuliu: function () {
        var that = this;
        var token = wx.getStorageSync("userinfo").wap_token;
        var order_no = this.data.order_no;
        var data = {
            url: "/wsgoods/ordergoodsno/wuliu",
            token: token,
            order_no: order_no
        };
        utils.request(data).then(function (res) {
            if (res.code == 0) {
                var data = res.data;
                if (data.length == 1) {//自动跳转
                  wx.navigateTo({
                    url: '/pages/shop/logistics/detail/index?kd_no=' + data[0].kd_no + '&kd_code=' + data[0].list[0].kd_code,
                  })
                }
                that.setData({
                    data: data,
                });
            } else {

            }
        });
    },
})